#application jar file will be first in classpath
CLASSPATH=.:lib/webapp.jar

#add all jars except application jar from lib folder to the classpath
JARS=$(ls -a lib | grep -v webapp.jar | grep .jar)
for jar in $JARS
do
    CLASSPATH=$CLASSPATH':lib/'$jar
done

#add jars for jsp support to the classpath
JSP=$(ls -a lib/jsp | grep .jar)
for jar in $JSP
do
    CLASSPATH=$CLASSPATH':lib/jsp/'$jar
done

echo "Starting application with classpath: $CLASSPATH"

#run java application in current shell
java -cp $CLASSPATH ru.server.Start
